import instance from "../utils/axios_config.js";

export {logoutApi, getUserInfoApi, updateAdminById, loginApi}

function loginApi(data) {
    return instance({
        'url': '/restful-api/login',
        'method': 'post',
        // params:data
        data: {...data}
    })
}

//获取用户信息

function getUserInfoApi(username) {
    return instance({
        'url': '/admin',
        'method': 'get',
        params: {username}
    })
}

function updateAdminById(params) {
    return instance({
        'url': '/admin/update',
        'method': 'put',
        data: params
    })
}

function logoutApi() {
    return instance({
        'url': '/restful-api/logout',
        'method': 'post',
    })
}
